package com.xiaoyu.lib_av.listener

import com.xiaoyu.lib_av.datamodel.CallFailType.CallFailTypeDef
import com.xiaoyu.lib_av.datamodel.CallHangUpType.HangUpTypeDef
import com.xiaoyu.lib_av.datamodel.CallMessage
import com.xiaoyu.lib_av.datamodel.CallParams
import com.xiaoyu.lib_av.datamodel.CallResponseType.CallResponseTypeDef

interface IVoiceCallLifecycleListener {

    // 收到呼叫
    fun onReceiveCall(fromUserId: String, params: CallParams, runnable: Runnable?);

    // 呼叫失败
    fun onCallFailed(fuid: String, @CallFailTypeDef errorType: String)

    // 响应呼叫
    fun onRespondCall(fuid: String, @CallResponseTypeDef responseType: String)

    // 收到响应
    fun onCallResponded(fuid: String, @CallResponseTypeDef responseType: String)

    // 取消呼叫
    fun onCancelCall(fuid: String)

    // 呼叫被取消
    fun onCallCanceled(callParams: CallParams)

    // 建立连接中
    fun onCallConnecting(fuid: String)

    // 成功建立连接
    fun onCallConnected(fuid: String)

    // 连接断开
    fun onCallDisconnected(fuid: String, @HangUpTypeDef hangupType: String)

    // 当前通话网络状态
    fun onNetStatusReported(good: Boolean, uid: String)

    // 语音播放设备改变回调
    fun onAudioDeviceChanged(headset: Boolean)

    // 通话状态
    fun onStatus(totalDurationInS: Long)

    fun onMessageSend(message: CallMessage)

    fun onMessageReceive(message: CallMessage)

    fun onRemoteAudioMuteStateChanged(fuid: String, mute: Boolean)

    fun onLocalAudioMuteStatusChanged(mute: Boolean)

    fun onTokenExpired()
}